import request from "@/utils/request";
import ConstTable from "./ConstTable";

// 获取打印数据源所有
export function getPrintDataAllList(query) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBasePrintData/All`,
        method: "GET",
        data: query
    });
}

// 获取打印数据源列表
export function getPrintDataList(query) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBasePrintData`,
        method: "GET",
        data: query
    });
}

// 删除打印数据源
export function delPrintData(id) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBasePrintData/${id}`,
        method: "DELETE"
    });
}

// 批量删除打印数据源
export function delPrintDataBatch(data) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBasePrintData/BatchRemove`,
        method: "POST",
        data
    });
}

// 导出打印数据源列表
export function exportPrintData(query) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBasePrintData/Actions/Export`,
        method: "GET",
        data: query
    });
}

// 获取打印数据源信息
export function getPrintDataInfo(id) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBasePrintData/${id}`,
        method: "get"
    });
}

// 创建打印数据源
export function createPrintData(data) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBasePrintData`,
        method: "post",
        data: data
    });
}

// 更新打印数据源
export function updatePrintData(data) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBasePrintData/${data.id}`,
        method: "PUT",
        data: data
    });
}
